<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>

<c:if test="${!empty infoServices}">
	<h1>Services</h1>
	<table class="table table-hover">
		<tr>
			<th>Name</th>
			<th>Description</th>
			<th>Price</th>
			<th>Action</th>
		</tr>
		<c:forEach items="${infoServices}" var="infoService">
			<tr>
				<td>${infoService.service.nameService}</td>
				<td>${infoService.service.description}</td>
				<td><c:choose>
						<c:when test="${infoService.price==-1}">
							free
						</c:when>
						<c:when test="${infoService.price!=-1}">
							${infoService.price}
						</c:when>
					</c:choose></td>

				<td><c:choose>
						<c:when test="${infoService.canSubscribe==false}">
							<a class="btn update btn-success"
								href='<c:url value="/services/subcribe/${infoService.service.id}"></c:url>'>
								Subcribe</a>
						</c:when>
						<c:when test="${infoService.canSubscribe==true}">
						уже подписанно
						</c:when>
					</c:choose></td>
			</tr>
		</c:forEach>
	</table>
</c:if>
